<?php 
$root = $_SERVER['DOCUMENT_ROOT']."/sitraso/";
include_once $root."/class/class.fachadainterfaz.php";
include_once $root."/class/class.PacienteCH.php";
require_once "../aspectos/Seguridad.php";
$seguridad = Seguridad::getInstance();
$seguridad->escapeSQL($_POST);
$ci = $_POST["buscarci"];
if (isset($_POST["buscarci"])){
	$solicitud = new pacientech("","","","","",$ci,"","","","","","","","","","","","","","","","");
	if ($solicitud->autocompletar()==0){
		echo '<script type="text/javascript">';
		echo 'alert(\'El numero de historia del paciente es: '.$solicitud->get("historia").'\');';
		echo 'location.href="../principal.php?content=gestionarSolicitud&h='.$solicitud->get("historia").'"';
		echo '</script>';
    }else{
		echo '<script type="text/javascript">
			location.href="../principal.php?content=gestionarSolicitud&error=noExiste";
			</script>';
    } 
}else
	echo '<script type="text/javascript">
			alert("Hay un error de sistema, comuniquese con el administrador.");
			location.href="../principal.php?content=gestionarSolicitud&error=noExiste";
		  </script>';
?>
